import Vue from 'vue'
import VueRouter from 'vue-router'
import LayoutView from "@/views/layout/LayoutView.vue";
import HomeView from "@/views/home/HomeView.vue";
import ErrorView from "@/views/error/ErrorView.vue";
Vue.use(VueRouter)

const routes = [
    {
        path: "*",
        name: Error,
        component: ErrorView
    },
    {
        path: '/',
        name: 'Layout',
        component: LayoutView,
        children: [
            {
                path: "",
                name: "Home",
                component: HomeView
            },
            {
                path: "student/studentList",
                name: "StudentList",
                component: () => import('@/views/student/StudentList.vue')
            },
        ]
    }
]

const router = new VueRouter({
    mode:"history",
    routes
})

export default router
